//
//  MainTabView.swift
//  MakeMoney
//
//  Created by Fan ZhiQiang on 2024/12/6.
//

import SwiftUI

enum Tabs: Equatable, Hashable, Identifiable {
    var id: Self { self }
    case main, category, me
}

struct MainTabView: View {
    @State private var tabs = Tabs.main
    var body: some View {
        TabView(selection: $tabs) {
            MainView()
                .tabItem {
                    Label("首页", systemImage: "house")
                }
                .tag(Tabs.main)
            CategoryView()
                .tabItem {
                    Label("分类", systemImage: "compass.drawing")
                }
                .tag(Tabs.category)
            Text("我的")
                .tabItem {
                    Label("我的", systemImage: "person")
                }
                .tag(Tabs.me)
        }
        
    }
}

#Preview {
    MainTabView()
}
